package com.yfp.tissue.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 点位分成表
 * @TableName position_sharing
 */
@TableName(value ="position_sharing")
@Data
public class PositionSharing implements Serializable {
    /**
     * 主键ID
     */
    @TableId
    private Long id;

    /**
     * 点位ID
     */
    @Schema(description = "点位ID")
    private String positionId;

    /**
     * 创客用户ID
     */
    @Schema(description = "创客用户ID")
    private Long userId;

    /**
     * 分账账号
     */
    @Schema(description = "分账账号")
    private String accountNumber;

    /**
     * 分成比例（百分比）
     */
    @Schema(description = "分成比例（百分比）")
    private BigDecimal proportion;

    /**
     * 冻结天数
     */
    @Schema(description = "冻结天数")
    private Integer freezeDay;

    /**
     * 用户类型1特约商户2普通商户3个人4服务商
     */
    @Schema(description = "用户类型1特约商户2普通商户3个人4服务商")
    private Integer type;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PositionSharing other = (PositionSharing) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPositionId() == null ? other.getPositionId() == null : this.getPositionId().equals(other.getPositionId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getAccountNumber() == null ? other.getAccountNumber() == null : this.getAccountNumber().equals(other.getAccountNumber()))
            && (this.getProportion() == null ? other.getProportion() == null : this.getProportion().equals(other.getProportion()))
            && (this.getFreezeDay() == null ? other.getFreezeDay() == null : this.getFreezeDay().equals(other.getFreezeDay()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPositionId() == null) ? 0 : getPositionId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getAccountNumber() == null) ? 0 : getAccountNumber().hashCode());
        result = prime * result + ((getProportion() == null) ? 0 : getProportion().hashCode());
        result = prime * result + ((getFreezeDay() == null) ? 0 : getFreezeDay().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", positionId=").append(positionId);
        sb.append(", userId=").append(userId);
        sb.append(", accountNumber=").append(accountNumber);
        sb.append(", proportion=").append(proportion);
        sb.append(", freezeDay=").append(freezeDay);
        sb.append(", type=").append(type);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}